GXGetShapeIndex
You can use theGXGetShapeIndex
function to determine the geometry index of a geometric point.
long GXGetShapeIndex(gxShape source, long contour, long vector);
source
- A reference to the shape containing the desired geometric point.
contour
- The index of the contour within the shape containing the geometric point.
vector
- The index of the geometric point within that contour.
- function result
- The geometry index of the specified geometric point.
DESCRIPTION
TheGXGetShapeIndex
function returns as its function result the geometry index of the geometric point in thesource
shape's geometry that is identified by thecontour
andvector
parameters. The indexes you provide in thecontour
andvector
parameters are 1-based--for example, a value of 1 for thecontour
parameter indicates the first contour, and value of 2 indicates the second contour, and so on.Each geometric point in a geometry has a geometry index--if you consider a geometry as a list of geometric points starting from the first geometric point of the first contour to the last geometric point of the last contour, the geometry index of a particular geometric point is its position in this list. For example, for a shape with two contours, the first with 10 geometric points and the second with 5 geometric points, this function would return 14 if you set the
contour
parameter to 2 and thevector
parameter to 4.For the geometric shapes with only one contour--points, lines, curves, and rectangles-- you must pass a 1 in the
contour
parameter. For polygon and path shapes, the value you provide for thecontour
parameter must be greater than 0 and must be equal to or less than the actual number of contours in the shape. Otherwise, the function posts acontour_out_of_range
warning. Similarly, the value you provide for thevector
parameter must be equal to or less than the actual number of geometric points in the specified contour, or the function posts anindex_out_of_range_in_contour
warning and returns 0 as the function result.If you provide a source shape that is an empty shape, a full shape, or a shape that is not one of the geometric shape types, this function posts the error
graphic_type_does_not_have_multiple_contours
.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil index_is_less_than_one (debugging version) graphic_type_does_not_contain_points (debugging version) graphic_type_does_not_have_multiple_contours (debugging version) Warnings contour_out_of_range index_out_of_range_in_contour SEE ALSO
For a discussion of geometric points, see the section "About Geometric Shapes" beginning on page 2-5.To determine the number of contours in a shape, use the
GXCountShapeContours
function, which is described on page 2-136.To determine the number of geometric points in a contour, use the
GXCountShapePoints
function, which is described on page 2-137.To copy a range of geometric points from a shape's geometry, use the
GXGetShapePoints
function, which is described in the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help